<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE BangPatterns, MagicHash, UnboxedTuples #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# OPTIONS_GHC -O2 #-}</span><span>
</span><span id="line-3"></span><span class="hs-comment">-- We always optimise this, otherwise performance of a non-optimised</span><span>
</span><span id="line-4"></span><span class="hs-comment">-- compiler is severely affected</span><span>
</span><span id="line-5"></span><span class="hs-comment">--</span><span>
</span><span id="line-6"></span><span class="hs-comment">-- (c) The University of Glasgow 2002-2006</span><span>
</span><span id="line-7"></span><span class="hs-comment">--</span><span>
</span><span id="line-8"></span><span class="hs-comment">-- Unboxed mutable Ints</span><span>
</span><span id="line-9"></span><span>
</span><span id="line-10"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Data.FastMutInt</span><span class="hs-special">(</span><span>
</span><span id="line-11"></span><span>        </span><span class="annot"><a href="GHC.Data.FastMutInt.html#FastMutInt"><span class="hs-identifier">FastMutInt</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Data.FastMutInt.html#newFastMutInt"><span class="hs-identifier">newFastMutInt</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-12"></span><span>        </span><span class="annot"><a href="GHC.Data.FastMutInt.html#readFastMutInt"><span class="hs-identifier">readFastMutInt</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Data.FastMutInt.html#writeFastMutInt"><span class="hs-identifier">writeFastMutInt</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-13"></span><span>
</span><span id="line-14"></span><span>        </span><span class="annot"><a href="GHC.Data.FastMutInt.html#FastMutPtr"><span class="hs-identifier">FastMutPtr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Data.FastMutInt.html#newFastMutPtr"><span class="hs-identifier">newFastMutPtr</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-15"></span><span>        </span><span class="annot"><a href="GHC.Data.FastMutInt.html#readFastMutPtr"><span class="hs-identifier">readFastMutPtr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Data.FastMutInt.html#writeFastMutPtr"><span class="hs-identifier">writeFastMutPtr</span></a></span><span>
</span><span id="line-16"></span><span>  </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-17"></span><span>
</span><span id="line-18"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-19"></span><span>
</span><span id="line-20"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Bits.html#"><span class="hs-identifier">Data.Bits</span></a></span><span>
</span><span id="line-21"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#"><span class="hs-identifier">GHC.Base</span></a></span><span>
</span><span id="line-22"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/GHC.Ptr.html#"><span class="hs-identifier">GHC.Ptr</span></a></span><span>
</span><span id="line-23"></span><span>
</span><span id="line-24"></span><span class="annot"><a href="GHC.Data.FastMutInt.html#newFastMutInt"><span class="hs-identifier hs-type">newFastMutInt</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Data.FastMutInt.html#FastMutInt"><span class="hs-identifier hs-type">FastMutInt</span></a></span><span>
</span><span id="line-25"></span><span class="annot"><a href="GHC.Data.FastMutInt.html#readFastMutInt"><span class="hs-identifier hs-type">readFastMutInt</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Data.FastMutInt.html#FastMutInt"><span class="hs-identifier hs-type">FastMutInt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-26"></span><span class="annot"><a href="GHC.Data.FastMutInt.html#writeFastMutInt"><span class="hs-identifier hs-type">writeFastMutInt</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Data.FastMutInt.html#FastMutInt"><span class="hs-identifier hs-type">FastMutInt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-27"></span><span>
</span><span id="line-28"></span><span class="annot"><a href="GHC.Data.FastMutInt.html#newFastMutPtr"><span class="hs-identifier hs-type">newFastMutPtr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Data.FastMutInt.html#FastMutPtr"><span class="hs-identifier hs-type">FastMutPtr</span></a></span><span>
</span><span id="line-29"></span><span id="local-6989586621680774383"><span class="annot"><a href="GHC.Data.FastMutInt.html#readFastMutPtr"><span class="hs-identifier hs-type">readFastMutPtr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Data.FastMutInt.html#FastMutPtr"><span class="hs-identifier hs-type">FastMutPtr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680774383"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-30"></span><span id="local-6989586621680774380"><span class="annot"><a href="GHC.Data.FastMutInt.html#writeFastMutPtr"><span class="hs-identifier hs-type">writeFastMutPtr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Data.FastMutInt.html#FastMutPtr"><span class="hs-identifier hs-type">FastMutPtr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680774380"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span><span>
</span><span id="line-31"></span><span>
</span><span id="line-32"></span><span class="hs-keyword">data</span><span> </span><span id="FastMutInt"><span class="annot"><a href="GHC.Data.FastMutInt.html#FastMutInt"><span class="hs-identifier hs-var">FastMutInt</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="FastMutInt"><span class="annot"><a href="GHC.Data.FastMutInt.html#FastMutInt"><span class="hs-identifier hs-var">FastMutInt</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">MutableByteArray#</span></span><span> </span><span class="annot"><span class="hs-identifier hs-type">RealWorld</span></span><span class="hs-special">)</span><span>
</span><span id="line-33"></span><span>
</span><span id="line-34"></span><span id="newFastMutInt"><span class="annot"><span class="annottext">newFastMutInt :: IO FastMutInt
</span><a href="GHC.Data.FastMutInt.html#newFastMutInt"><span class="hs-identifier hs-var hs-var">newFastMutInt</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(State# RealWorld -&gt; (# State# RealWorld, FastMutInt #))
-&gt; IO FastMutInt
forall a. (State# RealWorld -&gt; (# State# RealWorld, a #)) -&gt; IO a
</span><span class="hs-identifier hs-var">IO</span></span><span> </span><span class="annot"><span class="annottext">((State# RealWorld -&gt; (# State# RealWorld, FastMutInt #))
 -&gt; IO FastMutInt)
-&gt; (State# RealWorld -&gt; (# State# RealWorld, FastMutInt #))
-&gt; IO FastMutInt
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621680774371"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680774371"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-35"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Int#
-&gt; State# RealWorld
-&gt; (# State# RealWorld, MutableByteArray# RealWorld #)
forall d. Int# -&gt; State# d -&gt; (# State# d, MutableByteArray# d #)
</span><span class="hs-identifier hs-var">newByteArray#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680774370"><span class="hs-identifier hs-var">size</span></a></span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680774371"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621680774369"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680774369"><span class="hs-identifier hs-var">s</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680774368"><span class="annot"><span class="annottext">MutableByteArray# RealWorld
</span><a href="#local-6989586621680774368"><span class="hs-identifier hs-var">arr</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-36"></span><span>  </span><span class="hs-special">(#</span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680774369"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">MutableByteArray# RealWorld -&gt; FastMutInt
</span><a href="GHC.Data.FastMutInt.html#FastMutInt"><span class="hs-identifier hs-var">FastMutInt</span></a></span><span> </span><span class="annot"><span class="annottext">MutableByteArray# RealWorld
</span><a href="#local-6989586621680774368"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-37"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span class="hs-glyph">!</span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">I#</span></span><span> </span><span id="local-6989586621680774370"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680774370"><span class="hs-identifier hs-var">size</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int
forall b. FiniteBits b =&gt; b -&gt; Int
</span><a href="../../base/src/Data.Bits.html#finiteBitSize"><span class="hs-identifier hs-var">finiteBitSize</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">)</span><span>
</span><span id="line-38"></span><span>
</span><span id="line-39"></span><span id="readFastMutInt"><span class="annot"><span class="annottext">readFastMutInt :: FastMutInt -&gt; IO Int
</span><a href="GHC.Data.FastMutInt.html#readFastMutInt"><span class="hs-identifier hs-var hs-var">readFastMutInt</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Data.FastMutInt.html#FastMutInt"><span class="hs-identifier hs-type">FastMutInt</span></a></span><span> </span><span id="local-6989586621680774364"><span class="annot"><span class="annottext">MutableByteArray# RealWorld
</span><a href="#local-6989586621680774364"><span class="hs-identifier hs-var">arr</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(State# RealWorld -&gt; (# State# RealWorld, Int #)) -&gt; IO Int
forall a. (State# RealWorld -&gt; (# State# RealWorld, a #)) -&gt; IO a
</span><span class="hs-identifier hs-var">IO</span></span><span> </span><span class="annot"><span class="annottext">((State# RealWorld -&gt; (# State# RealWorld, Int #)) -&gt; IO Int)
-&gt; (State# RealWorld -&gt; (# State# RealWorld, Int #)) -&gt; IO Int
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621680774363"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680774363"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-40"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">MutableByteArray# RealWorld
-&gt; Int# -&gt; State# RealWorld -&gt; (# State# RealWorld, Int# #)
forall d.
MutableByteArray# d -&gt; Int# -&gt; State# d -&gt; (# State# d, Int# #)
</span><span class="hs-identifier hs-var">readIntArray#</span></span><span> </span><span class="annot"><span class="annottext">MutableByteArray# RealWorld
</span><a href="#local-6989586621680774364"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">0#</span></span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680774363"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621680774362"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680774362"><span class="hs-identifier hs-var">s</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680774361"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680774361"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-41"></span><span>  </span><span class="hs-special">(#</span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680774362"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int
</span><span class="hs-identifier hs-var">I#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680774361"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-42"></span><span>
</span><span id="line-43"></span><span id="writeFastMutInt"><span class="annot"><span class="annottext">writeFastMutInt :: FastMutInt -&gt; Int -&gt; IO ()
</span><a href="GHC.Data.FastMutInt.html#writeFastMutInt"><span class="hs-identifier hs-var hs-var">writeFastMutInt</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Data.FastMutInt.html#FastMutInt"><span class="hs-identifier hs-type">FastMutInt</span></a></span><span> </span><span id="local-6989586621680774360"><span class="annot"><span class="annottext">MutableByteArray# RealWorld
</span><a href="#local-6989586621680774360"><span class="hs-identifier hs-var">arr</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">I#</span></span><span> </span><span id="local-6989586621680774359"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680774359"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(State# RealWorld -&gt; (# State# RealWorld, () #)) -&gt; IO ()
forall a. (State# RealWorld -&gt; (# State# RealWorld, a #)) -&gt; IO a
</span><span class="hs-identifier hs-var">IO</span></span><span> </span><span class="annot"><span class="annottext">((State# RealWorld -&gt; (# State# RealWorld, () #)) -&gt; IO ())
-&gt; (State# RealWorld -&gt; (# State# RealWorld, () #)) -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621680774358"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680774358"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-44"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">MutableByteArray# RealWorld
-&gt; Int# -&gt; Int# -&gt; State# RealWorld -&gt; State# RealWorld
forall d.
MutableByteArray# d -&gt; Int# -&gt; Int# -&gt; State# d -&gt; State# d
</span><span class="hs-identifier hs-var">writeIntArray#</span></span><span> </span><span class="annot"><span class="annottext">MutableByteArray# RealWorld
</span><a href="#local-6989586621680774360"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">0#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680774359"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680774358"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621680774357"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680774357"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-45"></span><span>  </span><span class="hs-special">(#</span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680774357"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-46"></span><span>
</span><span id="line-47"></span><span class="hs-keyword">data</span><span> </span><span id="FastMutPtr"><span class="annot"><a href="GHC.Data.FastMutInt.html#FastMutPtr"><span class="hs-identifier hs-var">FastMutPtr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="FastMutPtr"><span class="annot"><a href="GHC.Data.FastMutInt.html#FastMutPtr"><span class="hs-identifier hs-var">FastMutPtr</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">MutableByteArray#</span></span><span> </span><span class="annot"><span class="hs-identifier hs-type">RealWorld</span></span><span class="hs-special">)</span><span>
</span><span id="line-48"></span><span>
</span><span id="line-49"></span><span id="newFastMutPtr"><span class="annot"><span class="annottext">newFastMutPtr :: IO FastMutPtr
</span><a href="GHC.Data.FastMutInt.html#newFastMutPtr"><span class="hs-identifier hs-var hs-var">newFastMutPtr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(State# RealWorld -&gt; (# State# RealWorld, FastMutPtr #))
-&gt; IO FastMutPtr
forall a. (State# RealWorld -&gt; (# State# RealWorld, a #)) -&gt; IO a
</span><span class="hs-identifier hs-var">IO</span></span><span> </span><span class="annot"><span class="annottext">((State# RealWorld -&gt; (# State# RealWorld, FastMutPtr #))
 -&gt; IO FastMutPtr)
-&gt; (State# RealWorld -&gt; (# State# RealWorld, FastMutPtr #))
-&gt; IO FastMutPtr
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621680774355"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680774355"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-50"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Int#
-&gt; State# RealWorld
-&gt; (# State# RealWorld, MutableByteArray# RealWorld #)
forall d. Int# -&gt; State# d -&gt; (# State# d, MutableByteArray# d #)
</span><span class="hs-identifier hs-var">newByteArray#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680774354"><span class="hs-identifier hs-var">size</span></a></span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680774355"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621680774353"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680774353"><span class="hs-identifier hs-var">s</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680774352"><span class="annot"><span class="annottext">MutableByteArray# RealWorld
</span><a href="#local-6989586621680774352"><span class="hs-identifier hs-var">arr</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-51"></span><span>  </span><span class="hs-special">(#</span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680774353"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">MutableByteArray# RealWorld -&gt; FastMutPtr
</span><a href="GHC.Data.FastMutInt.html#FastMutPtr"><span class="hs-identifier hs-var">FastMutPtr</span></a></span><span> </span><span class="annot"><span class="annottext">MutableByteArray# RealWorld
</span><a href="#local-6989586621680774352"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-52"></span><span>  </span><span class="hs-comment">-- GHC assumes 'sizeof (Int) == sizeof (Ptr a)'</span><span>
</span><span id="line-53"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span class="hs-glyph">!</span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">I#</span></span><span> </span><span id="local-6989586621680774354"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680774354"><span class="hs-identifier hs-var">size</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int
forall b. FiniteBits b =&gt; b -&gt; Int
</span><a href="../../base/src/Data.Bits.html#finiteBitSize"><span class="hs-identifier hs-var">finiteBitSize</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">)</span><span>
</span><span id="line-54"></span><span>
</span><span id="line-55"></span><span id="readFastMutPtr"><span class="annot"><span class="annottext">readFastMutPtr :: forall a. FastMutPtr -&gt; IO (Ptr a)
</span><a href="GHC.Data.FastMutInt.html#readFastMutPtr"><span class="hs-identifier hs-var hs-var">readFastMutPtr</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Data.FastMutInt.html#FastMutPtr"><span class="hs-identifier hs-type">FastMutPtr</span></a></span><span> </span><span id="local-6989586621680774350"><span class="annot"><span class="annottext">MutableByteArray# RealWorld
</span><a href="#local-6989586621680774350"><span class="hs-identifier hs-var">arr</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(State# RealWorld -&gt; (# State# RealWorld, Ptr a #)) -&gt; IO (Ptr a)
forall a. (State# RealWorld -&gt; (# State# RealWorld, a #)) -&gt; IO a
</span><span class="hs-identifier hs-var">IO</span></span><span> </span><span class="annot"><span class="annottext">((State# RealWorld -&gt; (# State# RealWorld, Ptr a #)) -&gt; IO (Ptr a))
-&gt; (State# RealWorld -&gt; (# State# RealWorld, Ptr a #))
-&gt; IO (Ptr a)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621680774349"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680774349"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-56"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">MutableByteArray# RealWorld
-&gt; Int# -&gt; State# RealWorld -&gt; (# State# RealWorld, Addr# #)
forall d.
MutableByteArray# d -&gt; Int# -&gt; State# d -&gt; (# State# d, Addr# #)
</span><span class="hs-identifier hs-var">readAddrArray#</span></span><span> </span><span class="annot"><span class="annottext">MutableByteArray# RealWorld
</span><a href="#local-6989586621680774350"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">0#</span></span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680774349"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621680774348"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680774348"><span class="hs-identifier hs-var">s</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680774347"><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621680774347"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-57"></span><span>  </span><span class="hs-special">(#</span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680774348"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Addr# -&gt; Ptr a
forall a. Addr# -&gt; Ptr a
</span><a href="../../base/src/GHC.Ptr.html#Ptr"><span class="hs-identifier hs-var">Ptr</span></a></span><span> </span><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621680774347"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-58"></span><span>
</span><span id="line-59"></span><span id="writeFastMutPtr"><span class="annot"><span class="annottext">writeFastMutPtr :: forall a. FastMutPtr -&gt; Ptr a -&gt; IO ()
</span><a href="GHC.Data.FastMutInt.html#writeFastMutPtr"><span class="hs-identifier hs-var hs-var">writeFastMutPtr</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Data.FastMutInt.html#FastMutPtr"><span class="hs-identifier hs-type">FastMutPtr</span></a></span><span> </span><span id="local-6989586621680774345"><span class="annot"><span class="annottext">MutableByteArray# RealWorld
</span><a href="#local-6989586621680774345"><span class="hs-identifier hs-var">arr</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span id="local-6989586621680774344"><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621680774344"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(State# RealWorld -&gt; (# State# RealWorld, () #)) -&gt; IO ()
forall a. (State# RealWorld -&gt; (# State# RealWorld, a #)) -&gt; IO a
</span><span class="hs-identifier hs-var">IO</span></span><span> </span><span class="annot"><span class="annottext">((State# RealWorld -&gt; (# State# RealWorld, () #)) -&gt; IO ())
-&gt; (State# RealWorld -&gt; (# State# RealWorld, () #)) -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621680774343"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680774343"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-60"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">MutableByteArray# RealWorld
-&gt; Int# -&gt; Addr# -&gt; State# RealWorld -&gt; State# RealWorld
forall d.
MutableByteArray# d -&gt; Int# -&gt; Addr# -&gt; State# d -&gt; State# d
</span><span class="hs-identifier hs-var">writeAddrArray#</span></span><span> </span><span class="annot"><span class="annottext">MutableByteArray# RealWorld
</span><a href="#local-6989586621680774345"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">0#</span></span><span> </span><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621680774344"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680774343"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621680774342"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680774342"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-61"></span><span>  </span><span class="hs-special">(#</span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680774342"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-62"></span></pre></body></html>